import java.util.Arrays;
import java.util.Locale;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-20
 * Time: 18:46
 */
public class TEST {
    public static void main(String[] args) {
        int []a = {1,4,5};
        int []b = {2,6,10};
        int []c = new int[6];
        int i = a.length-1;
        int j = b.length-1;
        int k = c.length-1;
        while( i >=0 && j>=0) {
            if( a[i] < b[j]) {
                c[k] = b[j];
                j--;
                k--;
            } else if( a[i] >= b[j]) {
                c[k] = a[i];
                i--;
                k--;
            }
        }
        while( j>=0) {
            c[k] = b[j];
            j--;
            k--;
        }
        while( i>=0) {
            c[k] = a[i];
            i--;
            k--;
        }
        System.out.println(Arrays.toString(c));
    }
}
